using System;
using System.Collections.Generic;
using System.Text;

namespace TTDotNet.Util
{
    class Misc
    {

        public Direction Combine(Direction dir1, Direction dir2)
        {
            List<Direction> list = new List<Direction>();
            list.Add(dir1);
            list.Add(dir2);

            if (list.Contains(Direction.NE) && list.Contains(Direction.SE))
            {
                return Direction.EW;
            }
            else if (list.Contains(Direction.SE) && list.Contains(Direction.SW))
            {
                return Direction.NS;
            }
            else if (list.Contains(Direction.SW) && list.Contains(Direction.NW))
            {
                return Direction.EW;
            }
            else if (list.Contains(Direction.NW) && list.Contains(Direction.NE))
            {
                return Direction.NS;
            }

            return Direction.None;
        }

        public Dimension airportSize(AirportType type)
        {
            if (type == AirportType.Small)
            {
                return new Dimension(4, 3);
            }
            else if (type == AirportType.City)
            {
                return new Dimension(6, 6);
            }
            else if (type == AirportType.Metropolitan)
            {
                return new Dimension(6, 6);
            }
            else if (type == AirportType.International)
            {
                return new Dimension(7, 7);
            }
            else { return new Dimension(1, 1); }
        }

        public int rotInDegrees(RotateType rotType)
        {
            if (rotType == RotateType.Zero)
            {
                return 0;
            }
            else if (rotType == RotateType.Ninety)
            {
                return 90;
            }
            else if (rotType == RotateType.OneEighty)
            {
                return 180;
            }
            else return 270;

        }

    }
}
